package day014.list;

import java.util.LinkedList;

public class LinkedListDemo1 {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(100);
        list.add(0, 200);
        list.add(300);
        list.add(200);

        System.out.println(list);

        list.addLast(1);
        list.addFirst(999);
        System.out.println(list);

        System.out.println(list.getLast());
        System.out.println(list.getFirst());

        list.removeFirst();
        list.removeLast();
        System.out.println(list);
    }
}
